import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutterproject/mvvm/base/base_state.dart';
import 'package:flutterproject/page/login_all/forget_pwd/controller/forget_pwd_controller.dart';
import 'package:flutterproject/page/login_all/login/widget/input_eye.dart';
import 'package:flutterproject/util/extension/int_extension.dart';
import 'package:flutterproject/util/margin_padding_util.dart';
import 'package:flutterproject/widget/button_common.dart';
import 'package:flutterproject/widget/image_extended.dart';
import 'package:flutterproject/widget/text/text_common.dart';
import 'package:get/get.dart';

class ForgetPwdPage extends BaseState<ForgetPwdController> {
  @override
  ForgetPwdController initController() => ForgetPwdController();

  @override
  Widget initView(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Container(
        width: Get.width,
        height: Get.height,
        padding: MarginPaddingUtil.symmetric(horizontal: 50),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            237.heightBox,
            TextCommon(
              "找回密码",
              size: 50.sp,
              color: Color(0xFFFF242429),
              fontWeight: FontWeight.bold,
            ),
            15.heightBox,
            Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                ImageCommon("/icon/quota_warn", size: 32.sp,),
                15.widthBox,
                TextCommon("验证账号", size: 28.sp,
                  color: Color(0xFF242429),
                  align: TextAlign.center,)
              ],
            ),
            172.heightBox,
            InputEye(
              hint: '请输入手机号',
              isPhone: true,
              controller: controller.textEditingController,
              onchange: (value) => controller.onChange(),
            ),
            Spacer(),
            GetBuilder<ForgetPwdController>(
              id: "next",
                builder: (logic) {
                  return ButtonCommon(
                    text: "下一步",
                    onTap: () {
                      controller.showConfirmDialog();
                    },
                    fontSize: 32.sp,
                    fontColor: Colors.white,
                    color: controller.isPhoneCorrect
                        ? Color(0xFFEDC88B)
                        : Color(0xFF6E6E6E).withOpacity(0.5),
                    borderRadios: 50,
                    padding: MarginPaddingUtil.only(top: 25, bottom: 29),
                  );
                }),
            36.heightBox,
          ],
        ),
      ),
    );
  }

}